#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;

double tosum;
int  m[5]; // 0.25, 0.10, 0.05, 0.01
double money[5]={0,0.25,0.10,0.05,0.01};

int tt[6];
int ans[6];
double now;
bool isfind;
int number, best;

void di(int pt)
{
    int i, len; 
    double mul;
	if (pt>4)
 	{
 	   if (fabs(now+mul-tosum)<1e-6)
 	   {
 	       isfind = true;
 	       best = number;
 	       for (i=1; i<=4; ++i)
 	       	 ans[i] = tt[i];
 	   }   
 	    	
    }
    else
    {
        len = m[pt];
        for (i=0; i<=len; ++i)
        {
            mul = i*money[pt];
            if (now + mul < tosum || fabs(now+mul-tosum)<1e-6)
            {
                now = now + mul;
                tt[pt] = i;
                number += i;
                if (number < best) di(pt+1);
                number -= i;
                now = now - mul;
            }    
        }    
    }            
}    

int main()
{
	while (cin >> tosum >> m[1]>>m[2]>>m[3]>>m[4])
	{
	    now=0;
	    best=1000;
	    number = 0;
	    isfind = false;
	    di(1);
	    if (!isfind) cout <<"NO EXACT CHANGE" << endl;
	    else
	    cout << ans[1] <<" "<< ans[2] <<" "<< ans[3] <<" "<< ans[4] << endl;
	}    
    
    return 0;
}    


